<?php
class ModalOverlay
{
  public function __constructor()
  {
  }

  public function construct($id, $title, $body="", $mainButtonLabel="Ok", $cancelButtonLabel="Cancel", $customFuncName="")
  {
    ?>
      <div <?php print "id='".$id."' "; ?> class="modal hide fade" tabindex="-1" role="dialog" 
                aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
          <h3 id="myModalLabel"><?php print $title; ?></h3>
        </div>
        <div class="modal-body">
          <?php print $body; ?>
        </div>
        <div class="modal-footer">
          <button class="btn" data-dismiss="modal" aria-hidden="true"><?php print $cancelButtonLabel;?></button>
          <button class="btn btn-primary" 
                <?php 
                  if ($customFuncName == "") 
                  {
                    print "onclick=\"handleOverlayOk();\"";
                  }
                  else
                  {
                    print "onclick=\"".$customFuncName."();\"";
                  }
                ?>
                >
                <?php print $mainButtonLabel; ?>
          </button>
        </div>
      </div>
    <?php
  }
}
?>